package com.knowledgegraph.zhongyao.service.impl;

import java.util.List;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.knowledgegraph.zhongyao.mapper.YangShengMapper;
import com.knowledgegraph.zhongyao.domain.YangSheng;
import com.knowledgegraph.zhongyao.service.IYangShengService;

/**
 * 养生知识Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-23
 */
@Service
public class YangShengServiceImpl implements IYangShengService 
{
    @Autowired
    private YangShengMapper yangShengMapper;

    /**
     * 查询养生知识
     * 
     * @param yangKey 养生知识主键
     * @return 养生知识
     */
    @Override
    public YangSheng selectYangShengByYangKey(String yangKey)
    {
        return yangShengMapper.selectYangShengByYangKey(yangKey);
    }

    /**
     * 查询养生知识列表
     * 
     * @param yangSheng 养生知识
     * @return 养生知识
     */
    @Override
    public List<YangSheng> selectYangShengList(YangSheng yangSheng)
    {
        return yangShengMapper.selectYangShengList(yangSheng);
    }

    /**
     * 新增养生知识
     * 
     * @param yangSheng 养生知识
     * @return 结果
     */
    @Override
    public int insertYangSheng(YangSheng yangSheng)
    {
        yangSheng.setYangKey(UUID.randomUUID().toString());
        return yangShengMapper.insertYangSheng(yangSheng);
    }

    /**
     * 修改养生知识
     * 
     * @param yangSheng 养生知识
     * @return 结果
     */
    @Override
    public int updateYangSheng(YangSheng yangSheng)
    {
        return yangShengMapper.updateYangSheng(yangSheng);
    }

    /**
     * 批量删除养生知识
     * 
     * @param yangKeys 需要删除的养生知识主键
     * @return 结果
     */
    @Override
    public int deleteYangShengByYangKeys(String[] yangKeys)
    {
        return yangShengMapper.deleteYangShengByYangKeys(yangKeys);
    }

    /**
     * 删除养生知识信息
     * 
     * @param yangKey 养生知识主键
     * @return 结果
     */
    @Override
    public int deleteYangShengByYangKey(String yangKey)
    {
        return yangShengMapper.deleteYangShengByYangKey(yangKey);
    }
}
